home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / winterp-1.13 / examples / man-br.lsp < prev    next >
Encoding:
Lisp/Scheme  |  1991-10-06  |  4.8 KB  |  137 lines

  1. ; -*-Lisp-*-
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;
  4. ; File:         man-br.lsp
  5. ; RCS:          $Header: man-br.lsp,v 1.5 91/10/05 18:30:54 mayer Exp $
  6. ; Description:  Load this file to create a simple manual page browser for
  7. ;        looking at formatted manual pages installed in
  8. ;        /usr/local/man/cat3/*.3X. I use this application to browse my Motif
  9. ;        manual pages, which are kept in that directory. To start WINTERP up
  10. ;        running man-br as a standalone application, do:
  11. ;        "winterp -init_file <path>/man-br.lsp -no_unix_server -no_init_msgs &"
  12. ;        where "<path>/man-br.lsp" is the full path to this file.
  13. ;        Assumptions:
  14. ;            (1) You have formatted manual pages for Motif
  15. ;                in /usr/local/man/cat3/*.3X.
  16. ;            (2) $PAGER environment variable is set to a paging
  17. ;                program such as "less" or "more". I've only tested
  18. ;                this with "less"... it is possible that
  19. ;                           "xterm -e more" will exit automatically if
  20. ;                displaying short pages...
  21. ;            (3) xterm(1) program is on your $PATH.
  22. ;        Hints:
  23. ;            The names of the Motif manual pages displayed in
  24. ;            the file-selection-box browser will be more
  25. ;            intuitive if you convert the manual page names to
  26. ;            long-filenames -- for details, see the
  27. ;            doc/build.doc script supplied with Motif 1.1.
  28. ;            (Within HP, you may pick up the longfilename
  29. ;            formatted manpages via anonymous ftp from
  30. ;            hplnpm.hpl.hp.com, directory pub,
  31. ;            file OSFMotif1.1.1-man-output.tar.Z)
  32. ; Author:       Niels Mayer, HPLabs
  33. ; Created:      Tue Jul  2 19:00:39 1991
  34. ; Modified:     Sat Oct  5 18:30:37 1991 (Niels Mayer) mayer@hplnpm
  35. ; Language:     Lisp
  36. ; Package:      N/A
  37. ; Status:       X11r5 contrib tape release
  38. ;
  39. ; WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  40. ; XLISP version 2.1, Copyright (c) 1989, by David Betz.
  41. ;
  42. ; Permission to use, copy, modify, distribute, and sell this software and its
  43. ; documentation for any purpose is hereby granted without fee, provided that
  44. ; the above copyright notice appear in all copies and that both that
  45. ; copyright notice and this permission notice appear in supporting
  46. ; documentation, and that the name of Hewlett-Packard and Niels Mayer not be
  47. ; used in advertising or publicity pertaining to distribution of the software
  48. ; without specific, written prior permission.  Hewlett-Packard and Niels Mayer
  49. ; makes no representations about the suitability of this software for any
  50. ; purpose.  It is provided "as is" without express or implied warranty.
  51. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  52.  
  53. ;;;
  54. ;;; resources for WinterpManBrowser and
  55. ;;; xterm displaying manual page ("xterm -name man-term")
  56. ;;;
  57. ;;; Mwm*WinterpManBrowser*iconImage: /usr/local/include/X11/bitmaps/xman-i.h
  58. ;;; Mwm*man-term*iconImage:          /usr/local/include/X11/bitmaps/xman-i.h
  59. ;;;
  60. ;;; !
  61. ;;; ! man-term == xterm -name man-term
  62. ;;; !
  63. ;;; ! man-term*name: xterm
  64. ;;; ! man-term*IconGeometry:
  65. ;;; ! man-term*title:
  66. ;;; ! man-term*iconName:
  67. ;;;                
  68. ;;; man-term*VT100*font:     -*-*-medium-r-*--10-*-*-*-m-*-iso8859-1
  69. ;;; man-term*VT100*boldFont: -*-*-bold-r-*--10-*-*-*-m-*-iso8859-1
  70. ;;; man-term*c132: false
  71. ;;; man-term*curses: true
  72. ;;; man-term*VT100*background: LightGrey
  73. ;;; man-term*VT100*foreground: Black
  74. ;;; ! man-term*background: White
  75. ;;; ! man-term*foreground: Black
  76. ;;; man-term*VT100*cursorColor: FireBrick
  77. ;;; man-term*jumpScroll: false
  78. ;;; man-term*logging: false
  79. ;;; man-term*logInhibit: true
  80. ;;; man-term*loginShell: false
  81. ;;; man-term*marginBell: false
  82. ;;; man-term*multiScroll: false
  83. ;;; man-term*reverseVideo: false
  84. ;;; man-term*reverseWrap: false
  85. ;;; man-term*saveLines: 0
  86. ;;; man-term*scrollBar: false
  87. ;;; man-term*scrollInput: false
  88. ;;; man-term*scrollKey: false
  89. ;;; man-term*signalInhibit: false
  90. ;;; man-term*tekInhibit: true
  91. ;;; man-term*tekStartup: false
  92. ;;; man-term*visualBell: false
  93. ;;;
  94.  
  95. (setq top_w
  96.       (send APPLICATION_SHELL_WIDGET_CLASS :new "winterpManBrowser" "WinterpManBrowser"
  97.         :XMN_TITLE "Motif Manual Page Browser"
  98.         :XMN_ICON_NAME "ManBrowser"
  99.         ))
  100.  
  101. (setq fsb_w 
  102.       (send XM_FILE_SELECTION_BOX_WIDGET_CLASS :new :managed "files" top_w
  103.     ))
  104. (send (send fsb_w :get_child :DIALOG_HELP_BUTTON) :unmanage)
  105. (send (send fsb_w :get_child :DIALOG_CANCEL_BUTTON) :unmanage)
  106.  
  107. (send fsb_w :set_callback :XMN_OK_CALLBACK
  108.       '(CALLBACK_VALUE)
  109.       '(
  110.     (let (
  111.           (filename (xm_string_get_l_to_r CALLBACK_VALUE))
  112.           )
  113.       (system (format NIL
  114.               "xterm -geometry 120x24 -name man-term -T ~A -n ~A -e $PAGER ~A &"
  115.               filename
  116.               (remove-path filename)
  117.               filename
  118.               ))
  119.       )
  120.     ))
  121.  
  122. (send fsb_w :do_search "/usr/local/man/cat3/*.3X")
  123.  
  124. (send top_w :realize)
  125.  
  126. (defun remove-path (string)
  127.   (do
  128.    ((i (1- (length string)) (1- i))
  129.     )
  130.    ((or (< i 0) (char= (char string i) #\/))
  131.     (if (< i 0)
  132.     string
  133.       (subseq string (1+ i)))
  134.     )
  135.    )
  136.   )
  137.